package com.wms.mapper;

import com.wms.entity.Purchase;
import com.wms.entity.PurchaseDetail;
import com.wms.entity.PurchaseGoods;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface PurchaseMapper {
    /**
     * 展示到货登记列表信息
     * @return
     */
    List<Purchase> selectAll();

    /**
     * 多条件查询
     * @return
     */
    List<Purchase> selectByCondition(Purchase condition);

    /**
     * 分页查询
     * @return
     */
    List<Purchase> selectByPage();

    /**
     * 根据到货单id查询对应采购原料详情
     * @param id
     * @return
     */
    List<PurchaseDetail> getPurchaseMaterialsById(int id);

    /**
     * 根据采购单号获取采购的商品信息
     * @param purchaseCode
     * @return
     */
    List<PurchaseGoods> selectPurchaseGoodsByCode(String purchaseCode);

    /**
     * 添加采购单
     * @param purchase
     * @return
     */
    int addPurchase(Purchase purchase);

    /**
     * 根据年份查询最大编码
     * @param year
     * @return
     */
    String getMaxCode(String year);
}
